home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / pvm34b3.zip / pvm34b3 / pvm3 / lib / pvmd.os2 < prev    next >
Text File  |  1997-08-03  |  2KB  |  82 lines

  1. #!/bin/sh
  2. #
  3. #    $Id: pvmd,v 1.1 1996/09/23 21:15:46 pvmsrc Exp $
  4. #
  5. #    Start the appropriate pvmd3.
  6. #    If PVM_ROOT is not set in environment,
  7. #        we try to guess it by combining the working directory with
  8. #        argv[0], otherwise it defaults to $HOME/pvm3.
  9. #    If PVM_ARCH is not set,
  10. #        we get it by execing $PVMROOT/lib/pvmgetarch.
  11. #
  12. #    03 Jun 1994  Manchek
  13. #
  14.  
  15. case "x$PVM_ROOT" in x )
  16.     case "$0" in
  17.     /*) PVM_ROOT="$0" ;;
  18.     *) PVM_ROOT=`pwd`/"$0" ;;
  19.     esac
  20.     PVM_ROOT=`echo "$PVM_ROOT" | sed -e 's/\/lib\/pvmd//'`
  21.     if [ -d $PVM_ROOT ]; then
  22.         export PVM_ROOT
  23.     else
  24.         if [ -d $HOME/pvm3 ]; then
  25.             PVM_ROOT=$HOME/pvm3
  26.             export PVM_ROOT
  27.         else
  28.             echo pvmd: PVM_ROOT not defined >&2
  29.             exit 1
  30.         fi
  31.     fi
  32. ;; esac
  33.  
  34. #
  35. # these lines let you set environment variables on systems
  36. # where a shell profile doesn't get read when rshing in.
  37. #
  38. if [ -f $PVM_ROOT/.pvmprofile ]; then
  39.     . $PVM_ROOT/.pvmprofile
  40. fi
  41. if [ -f $HOME/.pvmprofile ]; then
  42.     . $HOME/.pvmprofile
  43. fi
  44.  
  45. case "x$PVM_ARCH" in x | xUNKNOWN )
  46.     PVM_ARCH="`$PVM_ROOT/lib/pvmgetarch`"
  47.     case "x$PVM_ARCH" in x )
  48.         echo pvmd: can\'t set arch >&2
  49.         exit 1
  50.     ;; esac
  51. ;; esac
  52.  
  53. export PVM_ARCH
  54. # make a joyful noise.
  55. case "x$PVM_ARCH" in
  56. xSGI | xSGI5 | xSGIMP | xSGI64 | xSGIMP64 )
  57.     trap '' 2
  58. ;;
  59. xPGON )                # for PGONs with pexec
  60.     PEXEC=/bin/pexec   # change this if pexec resides elsewhere
  61.     if [ -x $PEXEC ];  then
  62.         if [ "x$NX_DFLT_SIZE" = x ]; then  NX_DFLT_SIZE=1; fi
  63.         for args do
  64.             if [ "$args" = "-s" -o "$args" = "-S" ]; then PGONSLAVE="-f"; fi
  65.             if [ "$CLSIZE" = "t" ]; then CLSIZE="f"; NX_DFLT_SIZE=$args; fi
  66.             if [ "$args" = "-sz" ]; then CLSIZE="t"; fi
  67.         done
  68.         PGONCALL="$PVM_ROOT/lib/$PVM_ARCH/pvmd3 $PGONSLAVE $*"
  69.         exec $PEXEC "$PGONCALL" -sz $NX_DFLT_SIZE
  70.         exit 1
  71.     fi
  72. ;; esac
  73.  
  74. if [ ! -f $PVM_ROOT/lib/$PVM_ARCH/pvmd3.exe ]; then
  75.     echo "pvmd: $PVM_ROOT/lib/$PVM_ARCH/pvmd3.exe doesn't exist." >&2
  76.     echo "Make sure PVM is built and PVM_ROOT is set correctly" >&2
  77.     exit 1
  78. fi
  79. exec $PVM_ROOT/lib/$PVM_ARCH/pvmd3.exe $@
  80. exit 1
  81.  
  82.